package com.lanzchina.lanclass.utils;

import com.lanzchina.lanclass.domain.Result;

public class ResultUtil {

    public static <T> Result<T> success(T object) {
        Result<T> result = new Result<>();
        result.setResponseStatus(1);
        result.setMessage("成功");
        result.setData(object);
        return result;
    }

    public static <T> Result<T> success() {
        return ResultUtil.success(null);
    }

    public static <T> Result<T> error(Integer code, String message) {
        Result<T> result = new Result<>();
        result.setResponseStatus(code);
        result.setMessage(message);
        return result;
    }
}
